using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SmartLink.Interfaces
{
    public interface IRepository<T> where T : class
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        /// <returns>Identity</returns>
        long Add(T entity);
        bool AddAll(IEnumerable<T> entities);

        bool Update(T entity);
        bool Update(IEnumerable<T> entities);

        bool Delete(T entity);
        bool DeleteById(long Id);
        bool Delete(Expression<Func<T, bool>> where);
        bool DeleteAll(IEnumerable<T> entities);

        void Clear();
        T GetById(long Id);
        T GetById(string Id);
        T Get(Expression<Func<T, bool>> where);
        IEnumerable<T> GetAll();
        IEnumerable<T> GetMany(Expression<Func<T, bool>> where);
        IEnumerable<T> GetAllLazy();
    }
}
